<?                  
        $delimiter = "&nbsp;";          
        $page_length = 8;           
        $first_page = floor($start_at / $page_length) * $page_length;                                                                                                                            
        $last_page = $first_page + $page_length;                   
        if ($last_page>count($page_list))                  
        {                  
            $last_page = count($page_list);                  
        }                  
                          
        if ($last_page-$first_page>0)                  
        {                  
                              
            echo $delimiter . "Page: ";       
            if ($start_at > 0)                  
            {                  
                print "<a class='pages' href='javascript:fb_edit (\"s\", ". ($start_at-1) . ")'>&laquo; Prev</a>$delimiter| ";                  
            }                  
            if ($first_page > 0)                  
            {                  
                print "<a class='pages' href='javascript:fb_edit (\"s\", 0)'>1</a>$delimiter";                  
                print "<a class='pages' href='javascript:fb_edit (\"s\", ". ($first_page-1) . ")'>...</a>$delimiter";                  
            }                   
                              
            for ($x=$first_page;$x<$last_page;$x++)                   
            {                   
                if ( $start_at==$x )                   
                {                   
                    print "<b class='button'>" . ($x+1) . "</b>$delimiter";                   
                }                   
                else                   
                {                   
                    print "<a class='pages' href='javascript:fb_edit (\"s\", ".$x.",\"k\", ".$page_list[$x].")'>" . ($x+1) . "</a>$delimiter";                   
                }                                                                                                                                 
            }                   
                              
            if ($x<count($page_list)-1)                  
            {                  
                print "<a class='pages' href='javascript:fb_edit (\"s\", ".$x.")'>...</a>$delimiter";                   
                print "<a class='pages' href='javascript:fb_edit (\"s\", ".(count($page_list)-1).")'>".count($page_list)."</a>$delimiter";                  
            }                   
                              
            if ($start_at<count($page_list)-1)                  
            {                  
                print "| <a class='pages' href='javascript:fb_edit (\"s\", ". ($start_at+1) . ")'>Next &raquo;</a>$delimiter";                   
            }                   
                              
            $start_id = $page_list[(count($page_list) - $start_at)-1];                  
            $end_id   = $page_list[$start_at+1];                  
                              
        }   
        else echo  $last_page . "/" . $first_page;              
?>